package 设计模式.行为型.发布订阅;

import java.util.ArrayList;
import java.util.List;

/**
 * description:
 *
 * @author 颜真明
 * @date 2024/3/12  9:52
 */
public class Publish {

    List<Subscribe> subscribes = new ArrayList<>();

    void notice(){
        noticeAll();
    }

    void add(Subscribe s){
        subscribes.add(s);
    }

    void noticeAll() {
        for(Subscribe s:subscribes) {
            s.refresh();
        }
    }
}
